package com.generic.mybatis.dal.interceptor.automap;

/**
 * 通过注解生成sql
 *
 * @author wuaj
 */
public class TableMapperHolder {

    private TableMapperHolder() {
    }

    private static TableMapperProvider provider;

    public static void setProvider(TableMapperProvider provider) {
        TableMapperHolder.provider = provider;
    }

    /**
     * 由传入的dto对象的class构建TableMapper对象，构建好的对象存入缓存中，以后使用时直接从缓存中获取
     *
     * @param dtoClass
     * @return TableMapper
     */
    public static TableMapper getTableMapper(Class<?> dtoClass) {
        return provider.getTableMapper(dtoClass);
    }

}
